package com.lcc.bank.tools.util.config;

import org.apache.commons.configuration.PropertiesConfiguration;

/**
 * @author lcc
 * @date 2017年6月12日
 * 配置文件参数获取类 三个方法 getInt getString getBoolean
 */
public class Config {

	private static PropertiesConfiguration config = PropertiesLoader
			.getConfiguration("config");

	public static int getInt(String key) {
		return config.getInt(key, 0);
	}

	public static String getString(String key) {
		return config.getString(key, "");
	}

	public static boolean getBoolean(String key) {
		return config.getBoolean(key, false);
	}

	public static String getNettyIp(){
		return Config.getString("netty.ip");
	}

	public static int getNettyPort(){
		return Config.getInt("netty.port");
	}

	public static String getReturnKey(){
		return Config.getString("return.key");
	}

	public static String getReturnMsg(String key){
		return Config.getString("return.msg."+key);
	}

	public static int getReturnTime(){
		return Config.getInt("return.time");
	}
}
